package com.guigu.erp.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageInfo;
import com.guigu.erp.mapper.DesignModuleDetailsMapper;
import com.guigu.erp.pojo.DesignModule;
import com.guigu.erp.pojo.DesignModuleDetails;
import com.guigu.erp.service.DesignModuleDetailsService;
import com.guigu.erp.utils.PageUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ClassName:DesignModuleDetailsServiceImpl
 * Package:com.guigu.erp.service.impl
 * Description:
 *
 * @Date:2024/3/7 15:16
 * @Author:chenchong
 */

@Service
public class DesignModuleDetailsServiceImpl extends ServiceImpl<DesignModuleDetailsMapper,DesignModuleDetails> implements DesignModuleDetailsService {
    @Autowired
    private DesignModuleDetailsMapper designModuleDetailsMapper;
    @Override
    public PageUtils<DesignModuleDetails> selectId(int id) {
        QueryWrapper<DesignModuleDetails> qw=new QueryWrapper<DesignModuleDetails>();
        qw.eq("PARENT_ID",id);
        List<DesignModuleDetails> designModuleDetails = designModuleDetailsMapper.selectList(qw);
        PageInfo<DesignModuleDetails> p=new PageInfo<DesignModuleDetails>(designModuleDetails);
        PageUtils<DesignModuleDetails> page=new PageUtils<DesignModuleDetails>();
        page.setTotal(p.getTotal());
        page.setRows(p.getList());

        return page;
    }
}
